<?php
namespace App\Modules\Relationship\Models;


use App\Http\Services\CommonServices;
use App\Modules\Relationship\Interfaces\ModelInterface;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis;
use App\Http\Model\Base;

class CoupleHaveRingModel extends Base {

    protected $table = "rs_couple_have_ring";
    protected $fields = ['id', 'rs_code as rsCode', 'couple_id as coupleId',
        'ring_id as ringId', 'expire_time as expireTime'];
    protected $tablePrefix = '';

    public function __construct(array $attributes = [])
    {
        parent::__construct($this->table, $attributes);
        $this->tablePrefix = env('DB_PREFIX');
    }

    public function getRings ($ringId) : array {
        $condition = array(
            "id"=>$ringId,
            "is_deleted"=>0
        );
        $return = $this->getListByCondition($condition, $this->fields);
        return $return;
    }
}

